<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    <link rel="stylesheet" href="./styles/test.css">
    </head>
<body>
    <button> 点击我 </button>
    <script>
        // 获取元素
        let btn = document.querySelector('button')
        // 绑定事件
        btn.onclick = function(){
            alert('点击了按钮')
        }
    </script>
</body>
</html>